window.console = window.console || function() { var c = {}; return c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile = c.clear = c.exception = c.trace = c.assert = function() {}, c }(), String.prototype.m7trim = function() { return void 0 === this ? "" : this.replace(/^\s*/g, "").replace(/\s*$/g, "") };
var hostUrl = "http://localhost:8083/";
"http" != window.location.href.substr(0, 4) && (hostUrl = "http://localhost:8083/"),
    function() {
        var ie = !(!window.attachEvent || window.opera),
            wk = /webkit\/(\d+)/i.test(navigator.userAgent) && RegExp.$1 < 525,
            fn = [],
            run = function() { for (var i = 0; i < fn.length; i++) fn[i]() },
            d = document;
        d.ready = function(f) {
            if (!ie && !wk && d.addEventListener) return d.addEventListener("DOMContentLoaded", f, !1);
            if (!(1 < fn.push(f)))
                if (ie) ! function() { try { d.documentElement.doScroll("left"), run() } catch (err) { setTimeout(arguments.callee, 0) } }();
                else if (wk) var t = setInterval(function() { /^(loaded|complete)$/.test(d.readyState) && (clearInterval(t), run()) }, 0)
        }
    }();
var clientId = "",
    otherParams = "";
"string" == typeof qimoClientId && "undefined" != qimoClientId && (clientId = encodeURIComponent(qimoClientId)), "object" == typeof qimoClientId && (clientId = qimoClientId.userId || "");
var phoneSystemFrom = "",
    m7navigator = navigator.userAgent,
    isAndroidFlag = -1 < m7navigator.indexOf("Android") || -1 < m7navigator.indexOf("Linux"),
    isIOSFlag = !!m7navigator.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
isAndroidFlag && (phoneSystemFrom = "android"), isIOSFlag && (phoneSystemFrom = "ios");
var qimo_config = {
        chatHost: hostUrl,
        accessId: 0,
        language: "zh-CN",
        autoShow: !0,
        m7webchatpage: !1,
        version: "1.0",
        chatPage:"",
         // hostUrl + "SublimeText3Project/yayi/html/moor_chat.html"
        // companyConfigUrl: hostUrl + "SublimeText3Project/yayi/json/index/webchat.7moor.com/" + "online.html",
        urlTitle: encodeURIComponent(document.title),
        fromUrl: encodeURIComponent(window.location.href),
        clientId: clientId,
        location: window.location.host,
        otherParams: otherParams,
        M7CardInfo: {},
        referrer: document.referrer || "",
        videoPage: "https://rtc.7moor.com/",
        screenSharePage: "https://rtc.7moor.com:9443",
        userBehaviorVideoId: "",
        ubaOnOff: "false",
        sessionLastToPeer: "",
        proxyMsgUrl: "//webchat.7moor.com",
        uvpvSwitch: "false",
        sessionInvitation: "0",
        phoneSystemFrom: phoneSystemFrom,
        newMsgNotPop: !1,
        hasInitConfig: !1,
        reInitCallback: void 0,
        parseQuerystring: function(queryStr) {
            if ("string" != typeof queryStr) return {};
            if ("" === (queryStr = queryStr.m7trim())) return {};
            var json = {};
            try {
                for (var pairs = queryStr.split("&"), i = 0; i < pairs.length; i++) {
                    var kv = pairs[i].split("=");
                    kv[0] && kv[1] && (json[kv[0]] = decodeURIComponent(kv[1]))
                }
            } catch (e) {}
            return json
        }
    },
    href = window.location.href,
    headSimplifyFlag = !1;
if (0 < href.indexOf("?")) { var query_arr = href.split("?")[1].split("&"); try { for (var p = 0; p < query_arr.length; p++) { var temp = query_arr[p].split("="); "headSimplify" == temp[0] && "true" === temp[1] && (headSimplifyFlag = !0) } } catch (e) {} }
var simplifyFlag = headSimplifyFlag || "object" == typeof qimoClientId && qimoClientId.headSimplify;
// simplifyFlag && phoneSystemFrom && (qimo_config.chatPage = qimo_config.chatPage.replace("moor_chat.html", "moor_chat_simplify.html"));
var onlineData = void 0;
! function() {
    var scripts = { localInit: "7moorInit.js", pcChat: qimo_config.chatHost + "SublimeText3Project/yayi/js/QiMoIMSDK.js", ubaJs: "//user-analysis.7moor.com/js/uba.min.js", mobileBackJs: qimo_config.chatHost + "javascripts/mobileBackFunc.js" },
        Configure = {
            init: function() {
                var cookieSid = Configure.getCookie("parent_qimo_sid_" + qimo_config.accessId) || "",
                    data = { accessId: qimo_config.accessId, unionAccessId: qimo_config.unionAccessId, location: encodeURIComponent(window.location.host), referrer: document.referrer || "", callbackF: "getChatConfig", action: "getOnlineStates", sid: cookieSid || "" };
                this.loadJsonp(qimo_config.companyConfigUrl, data)
            },
            getCookie: function(key) { for (var arrCookie = document.cookie.split("; "), i = 0; i < arrCookie.length; i++) { var arr = arrCookie[i].split("="); if (arr[0] == key) return arr[1] } return "" },
            getInitJsData: function() {
                for (var src, s = document.getElementsByTagName("script"), i = 0, n = s.length; i < n; i++)
                    if ((src = s[i].src) && -1 < src.indexOf(scripts.localInit)) { src = src.toLowerCase(); break } if (src && 0 < src.indexOf("accessid=")) {
                    var querys = qimo_config.parseQuerystring(src.substr(src.indexOf("?") + 1));
                    qimo_config.accessId = querys.accessid, qimo_config.language = "en" === querys.language ? "en" : "zh-CN", querys.fromurl && (qimo_config.fromUrl = querys.fromurl), querys.autoshow && (qimo_config.autoShow = querys.autoshow), "true" === querys.m7webchatpage && (qimo_config.m7webchatpage = !0), querys.wap && (qimo_config.wap = querys.wap), querys.newmsgnotpop && (qimo_config.newMsgNotPop = querys.newmsgnotpop), querys.unionaccessid && (qimo_config.unionAccessId = querys.unionaccessid)
                }
                scripts.pcChat = scripts.pcChat + "?accessId=" + qimo_config.accessId
            },
            addJsElement: function(src) {
                var el = document.createElement("script");
                el.setAttribute("charset", "UTF-8"), el.src = src;
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(el, s)
            },
            loadJsonp: function(url, data) {
                var query = function(json) {
                        json = json || {};
                        var query_arr = [];
                        for (var key in json.__ = (new Date).getTime(), json) {
                            var val = json[key];
                            query_arr.push(key + "=" + encodeURIComponent(val))
                        }
                        return query_arr.join("&").replace(/%20/g, "+")
                    }(data),
                    script = document.createElement("script");
                script.type = "text/javascript", script.setAttribute("charset", "UTF-8"), script.src = url + "?" + query;
                try { document.body.appendChild(script) } catch (e) { document.ready(function() { document.body.appendChild(script) }) }
            },
            loadUbaJs: function() {
                var skey = "qimo_seosource_" + qimo_config.accessId,
                    times = 0,
                    interval = setInterval(function() { times++, (Configure.getCookie(skey) || 10 < times) && (Configure.addJsElement(scripts.ubaJs + "?v=" + qimo_config.version), clearInterval(interval)) }, 100)
            }
        };
    Configure.getInitJsData(), Configure.init(), window.getChatConfig = function(c) { onlineData = c, void 0 !== qimo_config.unionAccessId && void 0 !== c.accessId && (qimo_config.accessId = c.accessId), "true" !== c.ubaOnOff ? qimo_config.ubaOnOff = "false" : qimo_config.ubaOnOff = c.ubaOnOff, "true" !== c.uvpvSwitch ? qimo_config.uvpvSwitch = "false" : qimo_config.uvpvSwitch = c.uvpvSwitch, "1" !== c.sessionInvitation ? qimo_config.sessionInvitation = "0" : qimo_config.sessionInvitation = c.sessionInvitation, qimo_config.version = c.version, qimo_config.companyName = c.companyName, qimo_config.account = c.account, c.isSessionExist ? qimo_config.sessionLastToPeer = c.sessionToPeer : qimo_config.sessionLastToPeer = "", onlineData.pageTitle && qimo_config.m7webchatpage && (document.title = onlineData.pageTitle), !0 === onlineData.backJsEnable && Configure.addJsElement(scripts.mobileBackJs), !0 !== qimo_config.hasInitConfig ? (Configure.addJsElement(scripts.pcChat + "&v=" + qimo_config.version), Configure.loadUbaJs(), qimo_config.hasInitConfig = !0) : window.qimosdk.reInitChat(onlineData, function() { console.log("切换完成") }) }, window.m7InitConfigure = Configure
}();